// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   PCSUtil.java

package com.vandagroup.common.webapp;

import com.vandagroup.common.db.ESSDataStoreManager;
import java.sql.*;

public class PCSUtil
{

    private static String dbName = "pcs";

    public PCSUtil()
    {
    }

    public static String getSysStatus()
        throws Exception
    {
        String sysStatus;
        sysStatus = "";
        String sql = "select XTCSQZ from C_ZXXT_CSB where XTCSBS='sys_status'";
        Connection conn = null;
        Statement statement = null;
        ResultSet resultset = null;
        try
        {
            conn = ESSDataStoreManager.getInstance().getConnection(dbName);
            statement = conn.createStatement();
            resultset = statement.executeQuery(sql);
            if(resultset.next())
                sysStatus = resultset.getString("XTCSQZ");
            if(!sysStatus.equals("0"))
                sysStatus = "1";
        }
        catch(SQLException ex1)
        {
            throw ex1;
        }
        finally
        {
            if(resultset != null)
                try
                {
                    resultset.close();
                }
                catch(SQLException sqlexception) { }
            if(statement != null)
                try
                {
                    statement.close();
                }
                catch(SQLException sqlexception1) { }
            try
            {
                ESSDataStoreManager.getInstance().freeConnection(conn, dbName);
            }
            catch(Exception e)
            {
                e.printStackTrace();
            }
        }
        return sysStatus;
    }

}
